#include <logbase.h>
#include <genrand.h>
#include <sm4.h>
#include <hexstr.h>
// 验证网站
// https://i.goto327.top/CryptTools/SymmCrypt.aspx
int main(int argc, char **argv)
{
    uint8_t checkKey[16] = {0};
    uint8_t originStr[16] = {0};
    genRandHexBuf(checkKey, sizeof(checkKey));
    genRandHexBuf(originStr, sizeof(originStr));
    logHexBufStr("sm4 check key str", (const char *)checkKey, sizeof(checkKey));
    logHexBufStr("sm4 check origin str", (const char *)originStr, sizeof(originStr));
    sm4EncrypteMulti(originStr, originStr, sizeof(originStr), checkKey);
    logHexBufStr("sm4 check enc str", (const char *)originStr, sizeof(originStr));
    sm4DecrypteMulti(originStr, originStr, sizeof(originStr), checkKey);
    logHexBufStr("sm4 check dec str", (const char *)originStr, sizeof(originStr));
    // logdebugc("org:%s", originStr);
    // sm4EncryptePro1(originStr, sizeof(originStr), checkKey);
    // logdebugc("enc:%s", originStr);
    // sm4DecryptePro1(originStr, sizeof(originStr), checkKey);
    // logdebugc("dec:%s", originStr);
    return 1;
}
